package Pet.Management.repository;

import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import Pet.Management.domain.entity.Tag;

@Repository
public interface TagRepository extends JpaRepository<Tag, Long> {
    
    /**
     * 根据标签名查找标签
     */
    Optional<Tag> findByName(String name);
    
    /**
     * 查询所有标签并按名称排序
     */
    List<Tag> findAllByOrderByNameAsc();
} 